<?php
class testController extends accessController{
	public function test888(){
		// VG::$project_debug=false;
		$core_abc=new core_abc();
        // echo VG::$forward;
		//p(dirname(VG::$ctl_file));
        // echo VG::$current_route;
        // echo $_SERVER['REQUEST_URI'];
        echo smart_url(array('action'=>'a','get'=>'name=111'));
        
		p(VG::$is_get);echo '<br />';
		p(VG::$is_post);echo '<br />';
		p(VG::$is_put);echo '<br />';
		p(VG::$is_delete);echo '<br />';
		p(VG::$is_ajax);echo '<br />';
		echo VG::$request_method;echo '<br />';
		
		$model=load_model('member_group');
		
		$t=$model->easy_cache(APPPATH.'runtime/aaa/',15)->easy_select();
		p($t);
		$_POST=array(
		'name'=>'admin', #<input name='name'>
		'age'=>'22', #<input name='age'>
		'sex'=>'男', #<input name='sex'>
		'email'=>'gaolf@php.net', #<input name='email'>
		'sub'=>'注册' #<input name='sub' type='submit'>
		);
		

		


		// $user=load_model('users');
		// p($user->easy_insert());



		
		// $user=load_model('users');
		// p($user->easy_insert());
		// p($user->test_insert());
		//p($user->easy_find(8));
		//p($user->field('id,name')->easy_find(8));
		//p($user->field('id,name')->where('1,2,3')->easy_select());
		//p($user->field('id,name')->where(array('name'=>'%mi%'))->order('id desc')->limit(5)->easy_select());
		//p($user->easy_delete(11));
		//p($user->field('sex, count(sex)')->group('sex')->easy_select());//按性别分组
		// p($user->field('sex,count(sex)')->group('sex')->having('avg(age)>20')->easy_select());
		// p($user->easy_total());
		
		$_POST=array(
		'id'=>9,
		'name'=>'zhangsan', #<input name='name'>
		'age'=>'33', #<input name='age'>
		'sex'=>'女', #<input name='sex'>
		'email'=>'zhangsan@126.com', #<input name='email'>
		'sub'=>'注册' #<input name='sub' type='submit'>
		);
		// p($user->easy_update());
		
		// $cat=load_model('cats');
		// $data=$cat->field('id,name as cname')  //主键 id 必取
		// ->easy_r_select(
		// //数组 关联的表名 字段列表 外键
		// array('articles', 'id,name,content', 'cid'));
		// p($data); 
		
		// $cat=load_model('cats');
		// $data=$cat->field('id,name') //不需要别名
		// ->easy_r_select(
		// array('articles', 'id,name,content', 'cid',
		// array('art', "id desc",5) ));
		// p($data); 
		// $cat=load_model('cats');
		
		// $data=$cat->field('id,name') //不需要别名
		// ->easy_r_select(
			// array('articles', 'id,name,content', 'cid',
			// array('art', "id desc") ),
			// array('tests', 'id,test ', 'cid',
			// array('test')  )
		// );
		// p($data); 
		// $m=M('link');
		// p($m);
		// $m=M();
		// p($m);
		
	}
	public function imp($tpl){
		include $tpl;
	}
	public function treeview($tpl){
		include $tpl;
	}
	
	public function dftp_add(){
		//$obj=new upload_remote();
		//echo $obj->add("common/uploads/2015/11/02/aaa.xls");
		//http://www.localhost.com/111/2015/11/02/aaa.xls
	}
	public function dftp_del(){
		//$obj=new upload_remote();
		//echo $obj->del("http://www.localhost.com/111/2015/11/02/aaa.xls");
	}
	public function mail123(){
		//$r=mysendmail('测试123','测试123','2282583002@qq.com');
		//var_dump($r);
	}
	public function captcha(){
		$html=<<<st
		<p>
			<label for="captcha">验证码</label>
			<input type="text" name="_verycode" id="_verycode" value="" style="width:188px;" />
            <span style="cursor:pointer;"><img src="?r=back/index/index/captcha" title="点击刷新" alt="验证码" onclick="this.src='?r=back/index/index/captcha&ts='+Math.random();"></span>
		</p>	
st;
		echo $html;
		
		/*
		<input type="text" name="logo" id="logo" class="input" value="" />[<a href="<?php echo url("back/upload/index/upload_0","callback=aaa")?>&moduleid=<?php echo $this->moduleid;?>&uniq=<?php echo $this->_UNIQ;?>&itemid=<?php echo intval($itemid);?>&controller=<?php echo VG::$control;?>&tb=123" class="example5">选择</a>]
		
		
		*/
		
		
		
	}
	public function uploadify_test($tpl){
		
		include $tpl;
	}
	
}